﻿///<reference path="../../scripts/jquery-1.4.4.min.js" />
///<reference path="../../scripts/kooboo/kooboo.form.js" />

$(function () {

    $(".select-all").click(function () {
        var checked = $(this).attr("checked");
        $("input[name=selected]").attr("checked", checked);
    });


    $(".delete-link").click(function (e) {
        e.preventDefault();
        if (confirm($(this).attr("message"))) {
            $(this).parents("form").submit();
        }
        return false;
    });

    $(".delete-form").submit(function () {
        var row = $(this).parents("tr:first");
        $(this).ajaxPost({
            success: function () {
                row.remove();
            }
        });
        return false;
    });
});